package com.ebt.m.customer.ui;

import android.os.Bundle;

import com.ebt.m.R;
import com.ebt.m.customer.constant.CustomerConstant;
import com.ebt.m.fragment.BaseFragment;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * 30天活动客户页面
 * @author Damon.Han
 */

public class FragmentActiveThirty extends BaseFragment {

    @BindView(R.id.list_view)
    ListViewActivieThirty mListView;
    Unbinder unbinder;

    public static FragmentActiveThirty newInstance(int from) {
        FragmentActiveThirty frg = new FragmentActiveThirty();
        Bundle bundle = new Bundle();
        bundle.putInt("from", from);
        frg.setArguments(bundle);
        return frg;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }


    @Override
    public void onCreateView(Bundle savedInstanceState) {
        setContentView(R.layout.fragment_active_30_customers);
        unbinder = ButterKnife.bind(this, contentView);
        contentView.postDelayed(new Runnable() {
            @Override
            public void run() {
                initValues();
            }
        }, CustomerConstant.Delay.FRAGMENT_UPDATE_DELAY);
    }


    @Override
    public void onDestroy() {
        super.onDestroy();
        unbinder.unbind();
    }


    public void initValues() {
        updateData();

    }


    private void updateData() {
        mListView.update(getArguments().getInt("from"));
    }


}
